The online racing simulator
Searching in All forums
(951 results)
Yisc[NL]
S3 licensed
Trying to rush things out is always a bad idea.
So while having a shower I came to the conclusion that the script that I just uploaded, has some flaws:

- setting a globalvar for a selection only a player has to see, really bad idea
- going from Sub 'SelectCar' back to Sub 'DoSinrsTops', not needed

So here's an adjusted one with the globalvar gone and being replaced with a SetCurrentPlayerVar and the call back to Sub 'DoSinrsTops' being removed from Sub 'SelectCar'.

If you want to, you could merge the code from Sub 'DrawButtons' into Sub 'SelectCar' but I like it to be two seperate subs as it's easier to read and you might want to use Sub 'DrawButtons' from some other point in the script.
Last edited by Yisc[NL], .
Yisc[NL]
S3 licensed
Have a go with this.
There's plenty of room for further improvements and I might have broken some things in the process of changing the code as well.
But now you can press the car button and it will display the data for that car.
I have also stopped closing all the buttons again and again.
Now only the buttons are closed that are displaying data.
Last edited by Yisc[NL], .
Yisc[NL]
S3 licensed
To me it looks a very complicated script, while you should try to use the same code for several cases. To accomplish this, use the name of the button that has been pressed and extract the carname from that buttonname.
Yisc[NL]
S3 licensed
Ah, now it makes sense again.
What we have been trying should be used to make a top ranking of stored values and is not about times.
I should have known and read better.
Thanks for clearing this up.
Yisc[NL]
S3 licensed
I did some testing using Lapper 7.0.4.10 (which is my operational version) and get the same results as sinanju.
Either the list is empty, or you get an error about missing argument or you get a huge error when using this: DoMyUserTop( "XFG","DESC","FALSE",1 );

The error being:

Lapper Instance 127.0.0.1/29994 abort!

Input string was not in a correct format.
mscorlib
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at System.Int32.Parse(String s)
at LFSLapper.LFSClient.getlisttopuser(unionVal val, ArrayList args)
at GLScript.GLApp.parseBackcall(SetOfVars GVAR, SetOfVars LVAR, unionVal val, ArrayList args)
at GLScript.Parseur.getval(SetOfVars GVAR, SetOfVars LVAR, executeParsedFunction BC)
at GLScript.Parseur.getval(SetOfVars GVAR, SetOfVars LVAR, executeParsedFunction BC)
at GLScript.GLApp.retrieveEvalVar(String funcName, TokenParse tkparse, TokenBuffer currTokenBuffer, SetOfVars GVAR, SetOfVars LVAR, Boolean breakFunc, Char& breakCar)
at GLScript.GLApp.privExecuteTokensPart(Int32 level, String funcName, SetOfVars GCAR, SetOfVars LVAR, Boolean breakable, Boolean inSwitchCase, Int32 start, Int32 end)
at GLScript.GLApp.privExecuteFunction(String funcName, String[] argsVals)
at GLScript.GLApp.parseBackcall(SetOfVars GVAR, SetOfVars LVAR, unionVal val, ArrayList args)
at GLScript.Parseur.getval(SetOfVars GVAR, SetOfVars LVAR, executeParsedFunction BC)
at GLScript.GLApp.retrieveEvalVar(String funcName, TokenParse tkparse, TokenBuffer currTokenBuffer, SetOfVars GVAR, SetOfVars LVAR, Boolean breakFunc, Char& breakCar)
at GLScript.GLApp.privExecuteTokensPart(Int32 level, String funcName, SetOfVars GCAR, SetOfVars LVAR, Boolean breakable, Boolean inSwitchCase, Int32 start, Int32 end)
at GLScript.GLApp.privExecuteTokensPart(Int32 level, String funcName, SetOfVars GCAR, SetOfVars LVAR, Boolean breakable, Boolean inSwitchCase, Int32 start, Int32 end)
at GLScript.GLApp.privExecuteFunction(String funcName, String[] argsVals)
at GLScript.GLApp.executeFunction(String funcName, String[] argsVals)
at Configurator.lexConfigurator.executeFunction(String funcName, infoPlayer pcurrInfoPlayer, String[] par)
at LFSLapper.LFSClient.managePacket(MSO mso)
at LFSLapper.LFSClient.Loop(Connect insimConnection)
at LFSLapper.LFSClient.doloop()
at LapperInstances.LapperInstance.doConnection()
Void StringToNumber(System.String, System.Globalization.NumberStyles, NumberBuffer ByRef, System.Globalization.NumberFormatInfo, Boolean)
Closing Instance...
Yisc[NL]
S3 licensed
Looking very impressive.
Seems well made and thought out.
Congrats on this release.
Yisc[NL]
S3 licensed
I made toptable a long time ago (2015) for you, which works in V7 of Lapper and could be good starting point to create what you want: https://www.lfs.net/forum/post/1883455#post1883455
Yisc[NL]
S3 licensed
Just ask here if you run into any problems and/or have questions. It might bring you back up to speed, as a lot has changed in Lapper (and I am far behind the latest versions as some of my scripts did not work with the latest releases) over the years.

It might also help other Lapper users that are scared to ask for anything (mostly because most questions that have been asked, come from people that only 'demand' things while being unregistered to LFS) or are struggling with things them selfs or have ideas they cannot realise.

I won't go as far as coding all that's been asked for or debugging all code that will be presented here (learning to do things your self is the best way to improve your self), but putting someone on the right track isn't a problem for me and if something really interesting comes along, I am sure I will start my dev environment to try and tackle the issue / answer the question.
Yisc[NL]
S3 licensed
Case just means that several actions can be done within the same sub.
In this case (no pun intende) all commands starting with ! are handled in the OnMSO sub.
When text is !laps case X is excuted
When text is !ver case Y is executed
ect.
So Case and button won't go together, unless you have text button and want several actions in that particular sub.
Yisc[NL]
S3 licensed
I got all buttons you made working and attached a file with all those buttons.

- download the file and rename it to: var_button.lpr
- put it in your 'includes' folder
- add a line to file addonsused.lpr to point to the new file
- restart Lapper by typing: !reload

You can bring up the buttons using: !btntst
Yisc[NL]
S3 licensed
I think that this does the trick:


openPrivButton( "button_lapper_version",160,122,20,10,5,-1,32,"^8Lapper version",Button_lapper_version );

Sub Button_lapper_version ( $KeyFlags,$id )
lapperVersion();
EndSub

Yisc[NL]
S3 licensed
When you create and LFS server, you can set an admin password in the GUI.
This is the setting:



Or in the config file "setup.cfg" with these lines:

// optional: admin password
/admin=TOPSECRET

The password you have entered, should also be added in the Lapper configuration file.
That can be found in: \bin\default\default_1.ini
Put the password in this line: $password = "AdminPassHere";
Yisc[NL]
S3 licensed
To prevent people from running into the same issue that Driftmonkey06370 recently had, I added a piece of code that is able to deal with it Smile

Changelog for Schedule V2.09:

-Added code to set to dectect Lapper date settings (using 2 or 4 digits for the year) and act accordingly

Change the extension of the files to .lpr and add them to addonsused.lpr to be able to use them.
Yisc[NL]
S3 licensed
Eureka, I have found the issue.
It's not a bug, it's a setting in file: LFSLapper.lpr

Please change this: $DateFormat = "dd/MM/yyyy";
To this: $DateFormat = "dd/MM/yy";

Then reload Lapper and all is working as expected *pfew I nearly lost my mind over this one* Face -> palm
Yisc[NL]
S3 licensed
Okay, I can reproduce the issue and it has to do with changing settings 1 hour before the start of an event (a setting I am never using, so I haven't ran into this bug).
I tried some quick debugging (while doing my daytime job) and cannot fix it in such short time frame.
Will investigate it further tonight or tomorrow and will get back to you.
Yisc[NL]
S3 licensed
I cannot open the RAR file.
Please use ZIP to pack it.
Yisc[NL]
S3 licensed
Could you remove your passwords from Lapper and then ZIP the whole Lapper directory and upload the ZIP file to this forum?
Then I will run it on my end to see if I can reproduce the problem.
Yisc[NL]
S3 licensed
I am running things on my D partion as well, so that cannot cause a problem.
Don't know if a modded version could cause this problem, but it should be easy to download the original version and try it with that.
Yisc[NL]
S3 licensed
Clear, maybe asking the obvious, but is the date and time on your computer set correctly?
Yisc[NL]
S3 licensed
Ah, we are slowly zooming in on the issue then Smile
Have you made the general settings (as shown in my screenshot)?
I don't see them in your screenshot and they are needed to run things.
Yisc[NL]
S3 licensed
Okay, this proofs the data is in the database, but when you type !schedule you don't get to see it?
You did load module "schedule.lpr" as well, did you?
Yisc[NL]
S3 licensed
Have you seen the actual data in the dabase?
The file size growing could be an indication as well, but is not a guarantee by any means.
Use DB Browser to access the database file (storedvalue.dbs) and check table "fi_stored" to see if the data you entered has been stored into the database.
It should look similar as this:

Yisc[NL]
S3 licensed
First thing that comes to mind is that it's not saving the information to the database. You could check the Lapper error file and see if anything is logged there. This can be found in: bin\default\logs
The filename should end with ERR.log
Please check that logfile and report any errors you see.
Also report the version of Lapper you are running.
You can see this by typing this in the LFS chat: !ver
Yisc[NL]
S3 licensed
The problem is not with LFS but with the latest releases of Lapper, which is the reason I am still running version 7.0.4.10 on my servers.
BassDriver knows about the issue, but it's a difficult one to tackle.
I will see if I can post an adjusted version here, that runs on the latest Lapper version.
Yisc[NL]
S3 licensed
Would it be possible to get the record ID in the output? For example with this code:


<?php 
          $list 
GetListTopgetConfigVarDefaultTopCar ), 0);
          IF ( 
getConfigVarDefaultTopCar ) == "XFG" )
          
THEN
            dumpVar 
$list );
          ENDIF
?>

Which outputs this:


$list[4,"Total"] = 5
$list[4,"DatePb"] = "2021/02/05"
$list[4,"Laps"] = 2
$list[4,"PbBestSplitDiffLast"] = 30180
$list[4,"SplitTime1"] = 114590
$list[4,"CName"] = "XFG"
$list[4,"NickName"] = "^1Yis^7c[^4NL] ^1^s4"
$list[4,"Group"] = ""
$list[4,"SplitTime2"] = 0
$list[4,"TimePb"] = "11:19"
$list[4,"PbLapTime"] = 144770
$list[4,"UserName"] = "yisc[nl]"
$list[4,"PbBestSplitDiff1"] = 41050
$list[4,"PbBestSplitDiff0"] = 45390
$list[4,"PbBestSplitDiff2"] = 0
$list[4,"Pos"] = 5
$list[4,"SplitTime0"] = 72720
$list[4,"ListPb"] = "144770,172800"

But when I look in the DB, I see this:



It would be very useful to have the record ID and use that in other places, so information can be combined.
FGED GREDG RDFGDR GSFDG